package com.weijian.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.weijian.entity.VideoPlaybackProgress;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * 视频播放进度Mapper接口
 */
@Mapper
public interface VideoPlaybackProgressMapper extends BaseMapper<VideoPlaybackProgress> {
    
    /**
     * 根据用户ID和视频ID获取播放进度
     * @param userId 用户ID
     * @param videoId 视频ID
     * @return 播放进度信息
     */
    @Select("SELECT * FROM video_playback_progress WHERE user_id = #{userId} AND video_id = #{videoId} LIMIT 1")
    VideoPlaybackProgress selectByUserIdAndVideoId(@Param("userId") Long userId, @Param("videoId") Long videoId);
}
